/*
 * Copyright 2023 LINE Corporation
 *
 * LINE Corporation licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech Do not edit the class manually.
 */
package com.linecorp.bot.messaging.model;



import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** FlexText */
@JsonTypeName("text")
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record FlexText(
    /** Get flex */
    @JsonProperty("flex") Integer flex,
    /** Get text */
    @JsonProperty("text") String text,
    /** Get size */
    @JsonProperty("size") String size,
    /** Get align */
    @JsonProperty("align") Align align,
    /** Get gravity */
    @JsonProperty("gravity") Gravity gravity,
    /** Get color */
    @JsonProperty("color") String color,
    /** Get weight */
    @JsonProperty("weight") Weight weight,
    /** Get style */
    @JsonProperty("style") Style style,
    /** Get decoration */
    @JsonProperty("decoration") Decoration decoration,
    /** Get wrap */
    @JsonProperty("wrap") Boolean wrap,
    /** Get lineSpacing */
    @JsonProperty("lineSpacing") String lineSpacing,
    /** Get margin */
    @JsonProperty("margin") String margin,
    /** Get position */
    @JsonProperty("position") Position position,
    /** Get offsetTop */
    @JsonProperty("offsetTop") String offsetTop,
    /** Get offsetBottom */
    @JsonProperty("offsetBottom") String offsetBottom,
    /** Get offsetStart */
    @JsonProperty("offsetStart") String offsetStart,
    /** Get offsetEnd */
    @JsonProperty("offsetEnd") String offsetEnd,
    /** Get action */
    @JsonProperty("action") Action action,
    /** Get maxLines */
    @JsonProperty("maxLines") Integer maxLines,
    /** Get contents */
    @JsonProperty("contents") List<FlexSpan> contents,
    /** Get adjustMode */
    @JsonProperty("adjustMode") AdjustMode adjustMode,
    /** Get scaling */
    @JsonProperty("scaling") Boolean scaling)
    implements FlexComponent {
  /** Gets or Sets align */
  public enum Align {
    @JsonProperty("start")
    START,
    @JsonProperty("end")
    END,
    @JsonProperty("center")
    CENTER,

    @JsonEnumDefaultValue
    UNDEFINED;
  }

  /** Gets or Sets gravity */
  public enum Gravity {
    @JsonProperty("top")
    TOP,
    @JsonProperty("bottom")
    BOTTOM,
    @JsonProperty("center")
    CENTER,

    @JsonEnumDefaultValue
    UNDEFINED;
  }

  /** Gets or Sets weight */
  public enum Weight {
    @JsonProperty("regular")
    REGULAR,
    @JsonProperty("bold")
    BOLD,

    @JsonEnumDefaultValue
    UNDEFINED;
  }

  /** Gets or Sets style */
  public enum Style {
    @JsonProperty("normal")
    NORMAL,
    @JsonProperty("italic")
    ITALIC,

    @JsonEnumDefaultValue
    UNDEFINED;
  }

  /** Gets or Sets decoration */
  public enum Decoration {
    @JsonProperty("none")
    NONE,
    @JsonProperty("underline")
    UNDERLINE,
    @JsonProperty("line-through")
    LINE_THROUGH,

    @JsonEnumDefaultValue
    UNDEFINED;
  }

  /** Gets or Sets position */
  public enum Position {
    @JsonProperty("relative")
    RELATIVE,
    @JsonProperty("absolute")
    ABSOLUTE,

    @JsonEnumDefaultValue
    UNDEFINED;
  }

  /** Gets or Sets adjustMode */
  public enum AdjustMode {
    @JsonProperty("shrink-to-fit")
    SHRINK_TO_FIT,

    @JsonEnumDefaultValue
    UNDEFINED;
  }

  public static class Builder {
    private Integer flex;
    private String text;
    private String size;
    private Align align;
    private Gravity gravity;
    private String color;
    private Weight weight;
    private Style style;
    private Decoration decoration;
    private Boolean wrap;
    private String lineSpacing;
    private String margin;
    private Position position;
    private String offsetTop;
    private String offsetBottom;
    private String offsetStart;
    private String offsetEnd;
    private Action action;
    private Integer maxLines;
    private List<FlexSpan> contents;
    private AdjustMode adjustMode;
    private Boolean scaling;

    public Builder() {}

    public Builder flex(Integer flex) {
      this.flex = flex;
      return this;
    }

    public Builder text(String text) {
      this.text = text;
      return this;
    }

    public Builder size(String size) {
      this.size = size;
      return this;
    }

    public Builder align(Align align) {
      this.align = align;
      return this;
    }

    public Builder gravity(Gravity gravity) {
      this.gravity = gravity;
      return this;
    }

    public Builder color(String color) {
      this.color = color;
      return this;
    }

    public Builder weight(Weight weight) {
      this.weight = weight;
      return this;
    }

    public Builder style(Style style) {
      this.style = style;
      return this;
    }

    public Builder decoration(Decoration decoration) {
      this.decoration = decoration;
      return this;
    }

    public Builder wrap(Boolean wrap) {
      this.wrap = wrap;
      return this;
    }

    public Builder lineSpacing(String lineSpacing) {
      this.lineSpacing = lineSpacing;
      return this;
    }

    public Builder margin(String margin) {
      this.margin = margin;
      return this;
    }

    public Builder position(Position position) {
      this.position = position;
      return this;
    }

    public Builder offsetTop(String offsetTop) {
      this.offsetTop = offsetTop;
      return this;
    }

    public Builder offsetBottom(String offsetBottom) {
      this.offsetBottom = offsetBottom;
      return this;
    }

    public Builder offsetStart(String offsetStart) {
      this.offsetStart = offsetStart;
      return this;
    }

    public Builder offsetEnd(String offsetEnd) {
      this.offsetEnd = offsetEnd;
      return this;
    }

    public Builder action(Action action) {
      this.action = action;
      return this;
    }

    public Builder maxLines(Integer maxLines) {
      this.maxLines = maxLines;
      return this;
    }

    public Builder contents(List<FlexSpan> contents) {
      this.contents = contents;
      return this;
    }

    public Builder adjustMode(AdjustMode adjustMode) {
      this.adjustMode = adjustMode;
      return this;
    }

    public Builder scaling(Boolean scaling) {
      this.scaling = scaling;
      return this;
    }

    public FlexText build() {
      return new FlexText(
          flex,
          text,
          size,
          align,
          gravity,
          color,
          weight,
          style,
          decoration,
          wrap,
          lineSpacing,
          margin,
          position,
          offsetTop,
          offsetBottom,
          offsetStart,
          offsetEnd,
          action,
          maxLines,
          contents,
          adjustMode,
          scaling);
    }
  }
}
